using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Data;
using System.Windows;

namespace EAppointmentsWPF
{
    public class StatusToGlyphConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string status = (string)value;

            Style style = null;

            switch (status)
            {
                case "Approved":
                    style = Application.Current.Resources["ApprovedGlyphStyle"] as Style;
                    break;

                case "Pending":
                    style = Application.Current.Resources["PendingGlyphStyle"] as Style;
                    break;
                
                case "Booked":
                    style = Application.Current.Resources["BookedGlyphStyle"] as Style;
                    break;
                case "Rejected":
                    style = Application.Current.Resources["RejectedGlyphStyle"] as Style;
                    break;
                case "Canceled":
                    style = Application.Current.Resources["CanceledGlyphStyle"] as Style;
                    break;
            }

            return style;
        }
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new Exception("The method or operation is not implemented.");
        }
        
    }
}
